﻿#define _CRT_SECURE_NO_WARNINGS 1

/*
日期差，主要考察日期计算器的相关内容
运算符重载，构造函数
*/

//每日一题_09
//[编程题]日期差值
//https://www.nowcoder.com/questionTerminal/ccb7383c76fc48d2bbc27a2a6319631c?f=discussion

#include <iostream>
using namespace std;

int GetMonthDay(int y, int m) {
    int month[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    if (m == 2 && ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0))
        return 29;
    return month[m];
}

class Date {
public:

    //构造日期
    Date(int year, int month, int day)
        : _year(year),
        _month(month),
        _day(day)
    {}

    //小于
    bool operator<(const Date& d) {
        if (_year < d._year) {
            return true;
        }
        else if (_year == d._year) {
            if (_month < d._month) {
                return true;
            }
            else if (_month == d._month) {
                if (_day < d._day) {
                    return _day < d._day;
                }
            }
        }

        return false;
    }
    //判断相等
    bool operator==(Date& d) {
        return _year == d._year &&
            _month == d._month &&
            _day == d._day;
    }
    //判断不等
    bool operator!=(Date& d) 
    {
        return !(*this == d);
    }

    //加等天数
    Date& operator+=(int day) {
        _day += day;
        while (_day > GetMonthDay(_year, _month)) {
            _day -= GetMonthDay(_year, _month);
            _month++;
            if (_month == 13) {
                _month = 1;
                _year += 1;
            }
        }
        return *this;
    }

    //前置++
    Date& operator++() {
        *this += 1;
        return *this;
    }
    //后置++
    Date operator++(int) {
        Date tmp = *this;
        *this += 1;

        return tmp;
    }
    //日期相减
    int operator-(const Date& d) {
        int flag = -1;
        int n = 0;
        Date min = d;
        Date max = *this;

        if (*this < d) {
            flag = 1;
            min = *this;
            max = d;
        }

        while (min != max) {
            ++min;
            ++n;
        }

        return flag * n;
    }

private:
    int _year = 0;
    int _month = 0;
    int _day = 0;
};

int main() 
{
    int year1 = 0, month1 = 0, day1 = 0;
    int year2 = 0, month2 = 0, day2 = 0;

    while (scanf("%4d%2d%2d", &year1, &month1, &day1) != EOF)
    {
        scanf("%4d%2d%2d", &year2, &month2, &day2);

        Date d1(year1, month1, day1);
        Date d2(year2, month2, day2);

        cout << d1 - d2 + 1 << endl;
    }
}
